import request from '/@/utils/request';

export function deptApi() {
	return {
		page(data: any) {
			return request({
				url: '/system/dept/page',
				method: 'get',
				params: data,
			});
		},
		tree() {
			return request({
				url: '/system/dept/tree',
				method: 'get',
			});
		},
		save(data: any) {
			return request({
				url: '/system/dept/save',
				method: 'post',
				data,
			});
		},
		update(data: any) {
			return request({
				url: '/system/dept/update',
				method: 'post',
				data,
			});
		},
		del(id: string) {
			return request({
				url: '/system/dept/delete',
				method: 'post',
				data: { id: id },
			});
		},
	};
}
